#include "dbviewercommon.h"


QString DbViewerCommon::getConnectionIcon(DataBaseType type, bool isActive)
{
    QString src = "";
    switch (type) {
    case DB_MYSQL: src = !isActive ? ":/res/mysql-normal.png" : ":/res/mysql-active.png"; break;
    case DB_SQLSERVER: src = !isActive ? ":/res/sqlserver-normal.png" : ":/res/sqlserver-active.png"; break;
    case DB_ACCESS: src = !isActive ? ":/res/access-normal.png" : ":/res/access-active.png"; break;
    case DB_SQLITE: src = !isActive ? ":/res/sqlite-normal.png" : ":/res/sqlite-active.png"; break;
    default: src = !isActive ? ":/res/mysql-normal.png" : ":/res/mysql-active.png"; break;
    }

    return src;

}

QString DbViewerCommon::getDbTypeName(DataBaseType type)
{
    switch (type)
    {
    case DB_MYSQL: return "MySql";
    case DB_SQLSERVER: return "SQLServer";
    case DB_ACCESS: return "Access";
    case DB_SQLITE: return "Sqlite";
    default:return "unknown db";
    }
}
